package com.example.mybiadushoujiweishi.activity.acivitys;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.example.mybiadushoujiweishi.activity.acivitys.utils.MyApplication;


public class LoginActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        SharedPreferences sharedPreferences= MyApplication.getSharedPreferences();
        boolean bool=sharedPreferences.getBoolean("login",false);
        if(bool){
            //进入欢迎页面
            Intent intent=new Intent(this,WelcomeActivity.class);
            startActivity(intent);
        }else{
            //进入引导页面
            startActivity(new Intent(this,GuideActivity.class));
        }
       finish();


       /* SharedPreferences shared = getSharedPreferences("shared", MODE_PRIVATE);
        isfirst = shared.getBoolean("isfirst", true);
        System.out.println(isfirst);
        if (!isfirst) {
            handler.sendEmptyMessageDelayed(GOHOME, TIME);

        } else {

            SharedPreferences.Editor editor = shared.edit();
            editor.putBoolean("isfirst", false);
            editor.commit();
            handler.sendEmptyMessageDelayed(GOGUIDE, TIME);
        }*/

    }


   /* public void GoHome() {
        Intent intent = new Intent(LoginActivity.this, WelcomeActivity.class);
        startActivity(intent);
        finish();
    }

    public void GoGuide() {
        Intent intent = new Intent(LoginActivity.this, GuideActivity.class);
        startActivity(intent);
        finish();
    }*/
}
